<?php
include (dirname(__FILE__) . '/classes/FirePHP.php');
require (dirname(__FILE__) . '/config/config.inc.php');
require (dirname(__FILE__) . '/classes/Archievement.class.php');
require (dirname(__FILE__) . '/classes/db.php');
//require (dirname(__FILE__) . '/classes/Facebook_login.php');
session_start();
if (!$_SESSION['awesome_id'])
    header('Location: login.php');
$db = new DB();

$archievements = $db->getUserArchievements($_SESSION['awesome_id']);
?>
<!DOCTYPE html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>AwesomePeople</title>
        <link rel="stylesheet" type="text/css"  href="css/style.css"/>
        <script type="text/javascript"  src="js/jquery.min.js"></script>
        <script type="text/javascript"  src="js/awesomepeople.js"></script>
        <script type="text/javascript"  src="js/init.js"></script>
    </head>
    <body>
        <div id="header">
            <div class="contentHeader">
                <a href="home" class="logo"></a>
                <div class="menu">
                    <a href="logout.php" >logout</a>
                    <ul>
                        <?php //if($htmlblock) echo $htmlblock  ?>
                    </ul>
                    <div class="decoMenu"></div>
                </div>
            </div>
        </div>
        <div align="center">
            <div id="left_col" class="col">
                <div class="over-box"></div>
                <div class="container">
                    <ul id="left_achievement_ul">
                        <?php
                        if (!empty($archievements['done'])) {
                            foreach ($archievements['done'] as $archievement) {
                                echo $archievement->printArchievement();
                            }
                        }
                        ?>
                    </ul>
                </div>
            </div>
            <div id="right_col" class="col">
                <div class="over-box"></div>
                <div class="container">
                    <div id="new_archievement_block">
                        <div id="ico_new_archievement" class='ico'> </div>
                        <a id="add_new_archievement">Quero conquistar algo novo!</a>
                    </div>
                    <ul id="right_achievement_ul">
                        <?php
                        if (!empty($archievements['undone'])) {
                            foreach ($archievements['undone'] as $archievement) {
                                echo $archievement->printArchievement();
                            }
                        }
                        ?>
                    </ul>
                </div>
            </div>
        </div>
    </body>
</html>
